/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.kosongkosong;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author ifnu
 */
public class FileUtils {

    public static String readFile(String fileName){
        try {
            BufferedReader reader = new BufferedReader(new FileReader("src/test/java/" + fileName));
            String line = null;
            StringBuilder builder = new StringBuilder();
            while ((line = reader.readLine()) != null) {
                builder.append(line);
            }
            reader.close();
            return builder.toString();
        } catch (IOException ex) {
            Logger.getLogger(FileUtils.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }
    public static void main(String[] args) {
        System.out.println(FileUtils.class.getResourceAsStream("/mainpage.html"));
        System.out.println(System.getProperty("user.dir"));
        System.out.println();
    }
}
